using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NGourd.Core.Reports
{
    public static class NodeCollectionExtensions
    {
        public static IEnumerable<ReportNode> Flatten(this ReportNode node)
        {
            yield return node;
            foreach (var child in node.Nodes)
                foreach (var item in child.Flatten())
                    yield return item;
        }
    }
}
